<?php
/**
 * 简单工厂模式----设计模式
 * Created by Jason.
 * User: Administrator
 * Date: 2019/12/7 0007
 * Time: 下午 3:06
 */

namespace app\index\service;


use app\index\interfaces\Product;

class ShippableProduct implements Product
{
    private $productPrice;

    private $shippingCosts;

    public function __construct(int $productPrice,int $shippingCosts)
    {
        $this->productPrice = $productPrice;
        $this->shippingCosts = $shippingCosts;
    }
    public function calculatePrice(): int
    {
        return $this->productPrice + $this->shippingCosts;
    }
}